// 库引入
import React, {Component} from 'react';
import {inject, observer} from 'mobx-react';
import classNames from 'classnames';

// 样式引入
import styles from './style.module.less';

@observer
class TotalProjectsTip extends Component {
  render() {
    return (
      <p className={classNames(styles.totalProjectsTip, this.props.className)} style={this.props.style}>
        共收录了<strong>{this.props.totalNum}</strong>个前端开源项目
      </p>
    );
  }
}

TotalProjectsTip.defaultProps = {
  totalNum: '**'
};

const InjectTotalProjectsTip = inject(({libsStore={}}) => ({totalNum: libsStore.totalNum}))(TotalProjectsTip);

export {
  TotalProjectsTip,
  InjectTotalProjectsTip
};